#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time     : 2024/9/2 15:53
# @Author   : MingTai
# @File     : add_some.py

def five_dou_rice():
    dict_1 = {"aa": 1, "bb": 2, "cc": 1, "dd": 2, "ee": 5, "ff": 2}
    dict_2 = {}
    for i in dict_1:
        if dict_1[i] != 1:
            dict_2[i] = dict_1[i]
    return dict_2


def sort(abc):
    for i in range(0, len(abc)):
        for j in range(0, len(abc)):
            if abc[i] > abc[j]:
                abc[i], abc[j] = abc[j], abc[i]

    return abc


def sort_list(sorted_list: list):
    if len(sorted_list) <= 1:
        return sorted_list
    for i in range(len(sorted_list)):
        for j in range(len(sorted_list) - i - 1):
            if sorted_list[j] > sorted_list[j + 1]:
                sorted_list[j], sorted_list[j + 1] = sorted_list[j + 1], sorted_list[j]
    return sorted_list


def quick_sort(sorted_list: list):
    if len(sorted_list) <= 1:
        return sorted_list
    mid = sorted_list[0]
    left = [i for i in sorted_list[1:] if i <= mid]
    right = [i for i in sorted_list[1:] if i > mid]
    finally_list = quick_sort(left) + [mid] + quick_sort(right)
    return finally_list


if __name__ == '__main__':
    abc = [1, 0, 9, 8, 3, 10, 99]
    print(quick_sort(abc))
